package com.lysh.test.netty;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.util.CharsetUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * @author liyishan
 * @date 2023/8/24 13:25
 * @apiNote
 */
@Slf4j
public class MyServerHandler3 extends SimpleChannelInboundHandler<ByteBuf> {
    /**
     * ctx.writeAndFlush(Unpooled.copiedBuffer("歪比巴卜~茉莉~Are you good~马来西亚~", CharsetUtil.UTF_8));  Client received: 歪比巴卜~茉莉~Are you good~马来西亚~
     * @param ctx
     * @param in
     */
    @Override
    public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) {

        System.out.println("Client received: " + in.toString(CharsetUtil.UTF_8));
    }
}
